{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/transpose-matrix/\n",
    "\n",
    "\n",
    "Runtime: 12 ms, faster than 96.14% of C++ online submissions for Transpose Matrix.\n",
    "Memory Usage: 10.9 MB, less than 82.08% of C++ online submissions for Transpose Matrix.\n",
    "\n",
    "\n",
    "```cpp\n",
    "#include <vector>\n",
    "#include <algorithm>\n",
    "#include <set>\n",
    "#include <iostream>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "class Solution {\n",
    "public:\n",
    "    vector<vector<int>> transpose(vector<vector<int>>& A) {\n",
    "        vector<vector<int>> matrix;\n",
    "        int rowLength = A.size();\n",
    "        int columnLength = A[0].size();\n",
    "        for (int columnIndex = 0; columnIndex< columnLength; columnIndex++) {\n",
    "            vector<int> newVector;\n",
    "            for (int rowIndex = 0; rowIndex < rowLength; rowIndex++) {\n",
    "                newVector.push_back(A[rowIndex][columnIndex]);\n",
    "            }\n",
    "            matrix.push_back(newVector);\n",
    "        }\n",
    "        return matrix;\n",
    "    }\n",
    "};\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
